package org.finesys.system.api.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.finesys.common.mp.core.base.BaseEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 租户菜单实体bean
 */
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("sys_tenant_menu")
public class SysTenantMenu extends BaseEntity {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "菜单id")
    private Long id;
    // 租户ID
    @NotNull(message = "租户ID不能为空")
    @Schema(description = "租户ID")
    private Long tenantId;
    /**
     * 父菜单ID
     */
    @NotNull(message = "菜单父ID不能为空")
    @Schema(description = "菜单父id")
    private String parentId;

    /**
     * 菜单名称
     */
    @NotBlank(message = "菜单名称不能为空")
    @Schema(description = "菜单名称")
    private String name;

    /**
     * 前端URL
     */
    @Schema(description = "前端路由标识路径")
    private String path;

    /**
     * 重定向地址
     */
    @Schema(description = "重定向地址")
    private String redirect;

    /**
     * 对应Vue组件
     */
    @Schema(description = "对应Vue组件")
    private String component;

    /**
     * 打开目标（ mainFrame、_blank、_self、_parent、_top）
     */
    @Schema(description = "打开目标")
    private String target;

    /**
     * 菜单权限标识
     */
    @Schema(description = "菜单权限标识")
    private String permission;

    /**
     * 图标
     */
    @Schema(description = "菜单图标")
    private String icon;

    /**
     * 路由缓冲
     */
    @Schema(description = "路由缓冲")
    private Integer keepAlive;

    /**
     * 菜单类型 （0菜单 1按钮）
     */
    @NotNull(message = "菜单类型不能为空")
    private String type;

    /**
     * 排序值
     */
    @Schema(description = "排序值")
    private Integer sortOrder;

    /**
     * 是否隐藏(1 隐藏 0 不隐藏)
     */
    @Schema(description = "是否隐藏")
    private String hidden;

    /**
     * 标题
     */
    @Schema(description = "标题")
    private String title;

    /**
     * 应用id
     */
    @Schema(description = "应用ID")
    private String applicationId;// 应用ID

    /**
     * 0--正常 1--删除
     */
    @TableLogic
    private String delFlag;

    /**
     * 开始时间
     */
    private transient String createTimeFrom;

    /**
     * 结束时间
     */
    private transient String createTimeTo;

}
